﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
using DataAnnotationsExtensions;
using System.Web.Mvc;
using MvcEnumDropDownList.Helpers;

namespace BenzInfo.Hockey.Grenadiers.Models
{
    [Table("Partners")]
    public class Partner
    {
        [Key]
        public int Id { get; set; }

        [LocalizationEnum(typeof(Resources.Models.Partner))]
        public enum CategoryEnum : byte
        {
            Platinum = 1,
            Gold,
            Silver,
            Bronze
        }

        [Required]
        [EnumDataType(typeof(CategoryEnum))]
        public int CategoryValue { get; set; }

        [Display(Name = "DisplayCategory", ResourceType = typeof(Resources.Models.Partner))]
        public CategoryEnum Category
        {
            get { return (CategoryEnum)CategoryValue; }
            set { CategoryValue = (int)value; }
        }

        [Required]
        [StringLength(100, MinimumLength = 2)]
        [Display(Name = "DisplayName", ResourceType = typeof(Resources.Models.Partner))]
        public string Name { get; set; }

        [FileExtensions("png|jpg|jpeg|gif")]
        [Display(Name = "DisplayPicture", ResourceType = typeof(Resources.Models.Partner))]
        public string Picture { get; set; }

        [Url(UrlOptions.RequireProtocol)]
        [Display(Name = "DisplayUrl", ResourceType = typeof(Resources.Models.Partner))]
        public string Url { get; set; }

        [Required]
        public int Position { get; set; }

        [Required]
        [Display(Name = "DisplayShowInCarousel", ResourceType = typeof(Resources.Models.Partner))]
        public bool ShowInCarousel { get; set; }

        [Required]
        [Display(Name = "DisplayShowInPartnersPage", ResourceType = typeof(Resources.Models.Partner))]
        public bool ShowInPartnersPage { get; set; }
    }
}